//
//  PracticeLevel2VC.m
//  LearnAnimals
//
//  Created by Admin on 1/9/13.
//  Copyright (c) 2013 THACHTUYET. All rights reserved.
//

#import "PracticeLevel2VC.h"
#import "Clock.h"
@interface PracticeLevel2VC ()
{
    Clock * clock;
}
@end

@implementation PracticeLevel2VC

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    CGRect rect = CGRectMake(0, 0, 200, 200);
    
    clock = [[Clock alloc]initWithFrame:rect Time:10];
    [self.view addSubview:clock];
    clock.center = CGPointMake(self.view.frame.size.width/ 2, 100);
    [clock run];
    // Do any additional setup after loading the view from its nib.
}
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    clock.center = CGPointMake(self.view.frame.size.width/ 2, 100);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)goBack:(id)sender
{
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.8];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
    [UIView commitAnimations];
    [self.navigationController popViewControllerAnimated:NO];
    
}
- (IBAction)goLeft:(id)sender
{
    
}
- (IBAction) goRight:(id)sender
{
    
}

@end
